package cn.ncupyh;

public class TankClassFight {
    public static void main(String[] args) {
        TankClass t1 = new TankClass("tank1",0,10);
        TankClass t2 = new TankClass("tank2",0,10);
        //打印炮弹数量
        t1.setBulletaAmount();
        t2.setBulletaAmount();
        //打印速度
        t1.PrintSpeed(t1.getSpeed());
        t2.PrintSpeed(t2.getSpeed());
        //开火
        System.out.println(t1.getName() + "开火:");
        t1.fire(1);
        System.out.println(t2.getName() + "开火:" );
        t2.fire(1);
        t2.fire(1);
        //加速
        t1.speedUp(80);
        t2.speedUp(90);
        //减速
        t1.speedDown(70);
        //打印炮弹数量
        t1.setBulletaAmount();
        t2.setBulletaAmount();
    }
}
